#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
const int N = 210;
int ans[N * N];
int main()
{
	char ch,lastch='0';
	int cnt = 0;
	int k = 0;
	while (cin >> ch) 
	{
		cnt++;  
		if (ch == lastch)  
		{
			ans[k]++;          
		}
		else
		{
			k++;
			ans[k] = 1;
			lastch = ch;
		}

	}
	cout << sqrt(cnt) << " ";
	for (int i = 0; i <= k; i++)
	{
		cout << ans[i] << " ";
	}
	cout << endl;
	return 0;
}